<template>
  <div>
    <div class="box">
      <div class="topBar">
        <el-form
          ref="queryForm"
          :model="queryForm"
          :inline="true"
          label-width="100px"
        >
          <el-form-item label="交易对手名称" prop="name">
            <el-input v-model="queryForm.name" placeholder="请输入"> </el-input>
          </el-form-item>
          <el-form-item label="日期" prop="date">
            <el-date-picker
              v-model="queryForm.date"
              type="daterange"
              range-separator="-"
              value-format="yyyyMMdd"
              start-placeholder="开始日期"
              end-placeholder="结束日期"
            />
          </el-form-item>
        </el-form>
        <div>
          <el-row>
            <el-col :span="16" style="text-align: left">
              <el-button type="primary" class="gray-btn">导入</el-button>
            </el-col>
            <el-col :span="8" style="text-align: right">
              <el-button type="primary" class="gray-btn">查询</el-button>
              <el-button type="primary" class="btn">重置</el-button>
            </el-col>
          </el-row>
        </div>
      </div>
      <div class="bottomInfo">
        <el-table :data="tableData" style="width: 100%">
          <el-table-column type="index" label="序号" align="center">
          </el-table-column>
          <el-table-column prop="ranking" label="排名" align="center">
          </el-table-column>
          <el-table-column prop="counterparty" label="交易对手" align="center">
          </el-table-column>
          <el-table-column prop="organization" label="机构" align="center">
          </el-table-column>
          <el-table-column prop="totalPoints" label="总分" align="center">
          </el-table-column>
          <el-table-column prop="thisLevel" label="当前等级" align="center">
          </el-table-column>
          <el-table-column prop="lastLevel" label="上次等级" align="center">
          </el-table-column>
          <el-table-column
            prop="operation"
            label="操作"
            width="100px"
            align="center"
          >
            <template slot-scope="scope">
              <el-button
                @click.native.prevent="changeRanking(scope.$index, scope.row)"
                type="text"
                size="small"
              >
                更改排名
              </el-button>
            </template>
          </el-table-column>
        </el-table>
        <el-pagination
          small
          background
          layout="prev, pager, next"
          :total="total"
          @current-change="pageFn"
        >
        </el-pagination>
      </div>
    </div>
  </div>
</template>
<script>
export default {
  data() {
    return {
      queryForm: {
        name: "",
        date: [],
      },
      selectList: [],
      tableData: [
        {
          ranking: "701",
          counterparty: "创兴银行有限公司",
          organization: "银行大楼",
          totalPoints: "0.0008",
          thisLevel: "战略客户",
          lastLevel: "战略客户",
        },
        {
          ranking: "702",
          counterparty: "河南修武农村商业银行股份有限公司",
          organization: "银行大楼",
          totalPoints: "0.0007",
          thisLevel: "重要客户",
          lastLevel: "重要客户",
        },
        {
          ranking: "703",
          counterparty: "泰安岱岳农村商业银行股份有限公司",
          organization: "银行大楼",
          totalPoints: "0.0007",
          thisLevel: "长尾客户",
          lastLevel: "长尾客户",
        },
      ],
      total: 0,
    };
  },
  mounted() {},
  methods: {
    changeRanking() {},
    // async searchBtn(page) {
    //   if (!this.queryForm.data) {
    //     this.queryForm.data = ["", ""];
    //   }
    //   const param = {
    //     ...this.queryForm,
    //     pn: 10,
    //     page: page,
    //     beginDate: this.queryForm.data[0],
    //     endDate: this.queryForm.data[1],
    //   };
    //   delete param.data;
    //   console.log(param, "param");
    //   let res = await bondRiskDetail(param);
    //   this.tableData = res.data.result;
    //   this.total = Number(res.data.totalResults);
    //   console.log(res, "123");
    // },
    resetFn() {
      this.queryForm = {
        // xxx
      };
    },
    pageFn(currentPage) {
      // this.searchBtn(currentPage);
    },
  },
};
</script>
<style lang="scss" scoped>
.box {
  display: flex;
  flex-direction: column;
  height: 100%;

  .topBar {
    background-color: #262d47;
    margin-bottom: 10px;
    padding: 20px 20px;
    padding-bottom: 10px;
  }

  .bottomInfo {
    flex: 1;
    width: 100%;
    background-color: #262d47;
    padding-bottom: 20px;
  }

  .el-pagination {
    text-align: right;
    margin-top: 10px;
  }

  .el-table {
    min-height: 440px;
  }

  .el-table ::v-deep th.el-table__cell {
    background-color: #1c2238 !important;
    color: #fff;
  }

  .tableBox {
    background-color: #262d47;
    flex: 1;
    padding: 15px 10px;
  }

  .bondCardTitle {
    height: 40px;
    background: #354060;
    font-size: 14px;
    font-family: PingFang-SC-Bold, PingFang-SC;
    font-weight: bold;
    color: #ffffff;
    padding: 10px 16px;
  }
}
</style>
